{% extends "dashboard/base.html" %}
{% load i18n %}
{% load materializecss %}
{% load staticfiles %}

{% block title %}
  {% trans "Edit address" context "" %} - {% trans "Orders" context "Dashboard orders list" %} - {{ block.super }}
{% endblock %}

{% block body_class %}body-orders{% endblock %}

{% block menu_orders_class %}active{% endblock %}

{% block header_menu %}
  {% url "dashboard:orders" as url %}
  {% include "dashboard/includes/_back-link.html" with url=url %}
{% endblock %}

{% block breadcrumbs %}
  <ul class="breadcrumbs breadcrumbs--history">
    <li>
      <a href="{% url "dashboard:orders" %}">
        {% trans "Orders" context "Dashboard orders list" %}
      </a>
    </li>
    <li class="hide-on-med-and-down">
      <a href="{% url "dashboard:order-details" order_pk=order.pk %}">
        #{{ order.pk }}
      </a>
    </li>
    <li class="back-mobile">
      <a href="{% url "dashboard:order-details" order_pk=order.pk %}">
        <svg data-src="{% static "dashboard/images/arrow_left.svg" %}" fill="#fff" width="20px" height="20px" />
      </a>
    </li>
    <li>
      <span class="breadcrumbs--ellipsed-item">
        {% if address_type == "shipping" %}
          {% trans "Shipping address" context "" %}
        {% else %}
          {% trans "Billing address" context "" %}
        {% endif %}
      </span>
    </li>
  </ul>
{% endblock %}

{% block content %}
  <div class="row">
    <div class="col s12 m9">
      <div class="card">
        <form method="post" novalidate>
          <div class="card-content">
            {% csrf_token %}
            <div class="row">
              {{ form|materializecss }}
            </div>
          </div>
          <div class="card-action right-align">
            <a href="{% url "dashboard:order-details" order_pk=order.pk %}" class="btn btn-flat">
              {% trans "Cancel" context "Dashboard cancel action" %}
            </a>
            <button type="submit" class="btn waves-effect waves-light">
              {% trans "Update" context "Dashboard update action" %}
            </button>
          </div>
        </form>
      </div>
    </div>
    <div class="col s12 m3"></div>
  </div>
{% endblock %}
